package com.diancan.dc.service.impl;

import java.util.List;
import com.diancan.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.diancan.dc.mapper.DcEvaluationInfoMapper;
import com.diancan.dc.domain.DcEvaluationInfo;
import com.diancan.dc.service.IDcEvaluationInfoService;
import com.diancan.common.core.text.Convert;

/**
 * 评价Service业务层处理
 * 
 * @author dc
 * @date 2021-12-30
 */
@Service
public class DcEvaluationInfoServiceImpl implements IDcEvaluationInfoService 
{
    @Autowired
    private DcEvaluationInfoMapper dcEvaluationInfoMapper;

    /**
     * 查询评价
     * 
     * @param id 评价主键
     * @return 评价
     */
    @Override
    public DcEvaluationInfo selectDcEvaluationInfoById(Long id)
    {
        return dcEvaluationInfoMapper.selectDcEvaluationInfoById(id);
    }

    /**
     * 查询评价列表
     * 
     * @param dcEvaluationInfo 评价
     * @return 评价
     */
    @Override
    public List<DcEvaluationInfo> selectDcEvaluationInfoList(DcEvaluationInfo dcEvaluationInfo)
    {
        return dcEvaluationInfoMapper.selectDcEvaluationInfoList(dcEvaluationInfo);
    }

    /**
     * 新增评价
     * 
     * @param dcEvaluationInfo 评价
     * @return 结果
     */
    @Override
    public int insertDcEvaluationInfo(DcEvaluationInfo dcEvaluationInfo)
    {
        dcEvaluationInfo.setCreateTime(DateUtils.getNowDate());
        return dcEvaluationInfoMapper.insertDcEvaluationInfo(dcEvaluationInfo);
    }

    /**
     * 修改评价
     * 
     * @param dcEvaluationInfo 评价
     * @return 结果
     */
    @Override
    public int updateDcEvaluationInfo(DcEvaluationInfo dcEvaluationInfo)
    {
        return dcEvaluationInfoMapper.updateDcEvaluationInfo(dcEvaluationInfo);
    }

    /**
     * 批量删除评价
     * 
     * @param ids 需要删除的评价主键
     * @return 结果
     */
    @Override
    public int deleteDcEvaluationInfoByIds(String ids)
    {
        return dcEvaluationInfoMapper.deleteDcEvaluationInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除评价信息
     * 
     * @param id 评价主键
     * @return 结果
     */
    @Override
    public int deleteDcEvaluationInfoById(Long id)
    {
        return dcEvaluationInfoMapper.deleteDcEvaluationInfoById(id);
    }
}
